package com.camp.android.trip.n.track.trip;

import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.camp.android.trip.n.track.R;

public class TripRecommendationsFragment extends ListFragment {

	private RecommendationsListAdapter adapter = null;
	private int trip_id; 
	
    public TripRecommendationsFragment(int trip_id) {
    	this.trip_id = trip_id;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.i("Tag","Created recommendations fragment");
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
    	
    	View rootView = inflater.inflate(R.layout.fragment_trip_recommendations, container, false);
        Log.i("tag","recommendations fragment view created");
        adapter = new RecommendationsListAdapter(inflater,getActivity());
        
        return rootView;
    }
    
    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
    	super.onActivityCreated(savedInstanceState); 
    	Log.i("TAG","TripRecommendationsFragment onActivityCreated");
    	setListAdapter(adapter);
    }
    
    @Override
    public void onListItemClick(ListView l, View v, int position, long id) {
    	Log.i("TAG","Clicked on pos "+position);
    	
    }
}
